<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Model;

/**
 * App\Models\Project
 *
 * @property int $id 项目ID
 * @property string|null $project_name 项目名称
 * @property string|null $project_sn 项目编号
 * @property int|null $project_code 项目编码
 * @property string|null $active_name 活动名称
 * @property string|null $sponsor 举办单位
 * @property string|null $company 我方付款公司
 * @property string|null $company_short 我方付款公司缩写
 * @property int|null $is_contract 1=允许签约0=不允许签约
 * @property int|null $status 0=待完结1=已完结
 * @property string|null $fee_type 费用类型
 * @property int|null $master_user_id 创建人
 * @property string|null $master_user_name 创建人名称
 * @property string|null $worker_user_id 负责人
 * @property string|null $worker_user_name 负责人名称
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property \Illuminate\Support\Carbon|null $deleted_at
 * @mixin \Eloquent
 */
class Project extends Model
{
    use HasDateTimeFormatter;
    use SoftDeletes;

    protected $table = 'project';


    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'project_start_time',
        'project_end_time',
        'check_list_image',
        'meeting_address',
        'number_of_attendees',
        'submit_info_end_time',
        'update_info_end',
    ];

    public function users()
    {
        return $this->belongsToMany(User::class);
    }

    // public function company()
    // {
    //     return $this->hasOne(Company::class, 'id', 'company_id');
    // }
}
